package com.zs.application.service.tuShare.impl;

import com.zs.application.service.tuShare.TuShareStockInfoService;
import com.zs.infrastructure.util.invoker.tushare.TuShareInvoker;
import com.zs.infrastructure.util.invoker.tushare.TuShareInvokerRequest;
import com.zs.infrastructure.util.invoker.tushare.reponse.TuShareIpoResponse;
import com.zs.infrastructure.util.invoker.tushare.reponse.TuShareStockBasicReponse;
import com.zs.infrastructure.util.invoker.tushare.request.TuShareStockBasicRequest;
import com.zs.infrastructure.util.invoker.tushare.request.TuShareStockIpoRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author
 * @date 2022/8/25 0025 下午 11:57
 * @desc 新闻相关数据抽取业务类
 **/
@Slf4j
@Service
public class TuShareStockInfoServiceImpl implements TuShareStockInfoService {

    @Autowired
    private TuShareInvoker tuShareInvoker;

    /**
     * 证券基础信息抽取
     */
    @Override
    public void extractStockBasic(TuShareStockBasicRequest tuShareStockBasicRequest) {
        tuShareInvoker.sendPost(tuShareStockBasicRequest, TuShareStockBasicReponse.class);
    }

    /**
     * IPO新股数据查询
     * @param tuShareStockIpoRequest
     */
    @Override
    public void extractNewShare(TuShareStockIpoRequest tuShareStockIpoRequest) {
        tuShareInvoker.sendPost(tuShareStockIpoRequest, TuShareIpoResponse.class);
    }
}
